package com.eastfair.es.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONObject;
import com.eastfair.core.base.R;
import com.eastfair.es.entity.AllLog;
import com.eastfair.es.entity.PointLog;
import com.eastfair.es.service.AllLogService;
import com.eastfair.es.service.PointLogService;
import com.eastfair.es.vo.AllLogVO;
import com.eastfair.es.vo.PointLogVo;
import com.eastfair.es.vo.SysLogVO;
import com.eastfair.log.point.PointEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


/**
 * elasticsearch 搜索引擎
 *
 * @author zhoudong
 * @version 0.1
 * @date 2018/12/13 15:33
 */
@Slf4j
@Service
public class AllLogServiceImpl implements AllLogService {

    @Override
    public List<AllLogVO> assembleLogList(List<AllLog> allLogList) {
        if (CollectionUtil.isEmpty(allLogList)) {
            return null;
        }
        List<AllLogVO> allLogVOList = new ArrayList<>();
        for (AllLog allLog : allLogList) {
            AllLogVO allLogVO = new AllLogVO();
            BeanUtils.copyProperties(allLog, allLogVO);
            allLogVOList.add(allLogVO);
        }
        return allLogVOList;
    }
}
